package Q263

class Main {

}

/**
 * 丑数
 * @author 23737
 * @date 2022.5.6
 */
fun main(){

}

class Solution {
    fun isUgly(num: Int): Boolean {
        var num = num
        if (num < 1) return false
        while (num % 5 == 0) {
            num /= 5
        }
        while (num % 3 == 0) {
            num /= 3
        }
        while (num % 2 == 0) {
            num = num shr 1
        }
        return num == 1
    }
}